﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Text;

using log4net;
using log4net.Config;

namespace AKMII.DMRA.DataLoader
{
    public class Logger
    {
        protected static readonly ILog log = LogManager.GetLogger("Log");

        static Logger()
        {
            if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["logging.config"]))
            {
                if (File.Exists(ConfigurationManager.AppSettings["logging.config"]))
                {
                    XmlConfigurator.Configure(new FileInfo(ConfigurationManager.AppSettings["logging.config"]));
                }
            }
        }

        public static void Info(object msg)
        {
            log.Info(msg);
        }

        public static void Info(object msg, Exception e)
        {
            log.Info(msg, e);
        }

        public static void Debug(object msg)
        {
            log.Debug(msg);
        }

        public static void Debug(object msg, Exception e)
        {
            log.Debug(msg, e);
        }

        public static void Error(object msg)
        {
            log.Error(msg);
        }

        public static void Error(object msg, Exception e)
        {
            log.Error(msg, e);
        }

        public static void Fatal(object msg)
        {
            log.Fatal(msg);
        }

        public static void Fatal(object msg, Exception e)
        {
            log.Fatal(msg, e);
        }

        public static void Warn(object msg)
        {
            log.Warn(msg);
        }

        public static void Warn(object msg, Exception e)
        {
            log.Warn(msg, e);
        }
    }
}
